package jannex.sql.extensions;

import jannex.Jannex;
import jannex.internal.ExceptionFactory;
import jannex.sql.extensions.ConnectionImpl;
import jannex.sql.extensions.ResultSetImpl;
import jannex.sql.JxConnection;
import jannex.sql.JxDatabaseMetaData;
import jannex.sql.JxResultSet;

import java.sql.DatabaseMetaData;
import java.sql.RowIdLifetime;
import java.sql.SQLException;

public class DatabaseMetaDataImpl implements JxDatabaseMetaData {

    private final DatabaseMetaData databaseMetaData;
    private final Jannex jannex;

    public DatabaseMetaDataImpl(DatabaseMetaData databaseMetaData, Jannex jannex) {
        this.databaseMetaData = databaseMetaData;
        this.jannex = jannex;
    }

    @Override
    public boolean allProceduresAreCallable() {
        try {
            return databaseMetaData.allProceduresAreCallable();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean allTablesAreSelectable() {
        try {
            return databaseMetaData.allTablesAreSelectable();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public String getURL() {
        try {
            return databaseMetaData.getURL();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public String getUserName() {
        try {
            return databaseMetaData.getUserName();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean isReadOnly() {
        try {
            return databaseMetaData.isReadOnly();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean nullsAreSortedHigh() {
        try {
            return databaseMetaData.nullsAreSortedHigh();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean nullsAreSortedLow() {
        try {
            return databaseMetaData.nullsAreSortedLow();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean nullsAreSortedAtStart() {
        try {
            return databaseMetaData.nullsAreSortedAtStart();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean nullsAreSortedAtEnd() {
        try {
            return databaseMetaData.nullsAreSortedAtEnd();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public String getDatabaseProductName() {
        try {
            return databaseMetaData.getDatabaseProductName();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public String getDatabaseProductVersion() {
        try {
            return databaseMetaData.getDatabaseProductVersion();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public String getDriverName() {
        try {
            return databaseMetaData.getDriverName();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public String getDriverVersion() {
        try {
            return databaseMetaData.getDriverVersion();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public int getDriverMajorVersion() {
        return databaseMetaData.getDriverMajorVersion();
    }

    @Override
    public int getDriverMinorVersion() {
        return databaseMetaData.getDriverMinorVersion();
    }

    @Override
    public boolean usesLocalFiles() {
        try {
            return databaseMetaData.usesLocalFiles();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean usesLocalFilePerTable() {
        try {
            return databaseMetaData.usesLocalFilePerTable();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsMixedCaseIdentifiers() {
        try {
            return databaseMetaData.supportsMixedCaseIdentifiers();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean storesUpperCaseIdentifiers() {
        try {
            return databaseMetaData.storesUpperCaseIdentifiers();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean storesLowerCaseIdentifiers() {
        try {
            return databaseMetaData.storesLowerCaseIdentifiers();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean storesMixedCaseIdentifiers() {
        try {
            return databaseMetaData.storesMixedCaseIdentifiers();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsMixedCaseQuotedIdentifiers() {
        try {
            return databaseMetaData.supportsMixedCaseQuotedIdentifiers();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean storesUpperCaseQuotedIdentifiers() {
        try {
            return databaseMetaData.storesUpperCaseQuotedIdentifiers();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean storesLowerCaseQuotedIdentifiers() {
        try {
            return databaseMetaData.storesLowerCaseQuotedIdentifiers();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean storesMixedCaseQuotedIdentifiers() {
        try {
            return databaseMetaData.storesMixedCaseQuotedIdentifiers();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public String getIdentifierQuoteString() {
        try {
            return databaseMetaData.getIdentifierQuoteString();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public String getSQLKeywords() {
        try {
            return databaseMetaData.getSQLKeywords();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public String getNumericFunctions() {
        try {
            return databaseMetaData.getNumericFunctions();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public String getStringFunctions() {
        try {
            return databaseMetaData.getStringFunctions();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public String getSystemFunctions() {
        try {
            return databaseMetaData.getSystemFunctions();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public String getTimeDateFunctions() {
        try {
            return databaseMetaData.getTimeDateFunctions();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public String getSearchStringEscape() {
        try {
            return databaseMetaData.getSearchStringEscape();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public String getExtraNameCharacters() {
        try {
            return databaseMetaData.getExtraNameCharacters();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsAlterTableWithAddColumn() {
        try {
            return databaseMetaData.supportsAlterTableWithAddColumn();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsAlterTableWithDropColumn() {
        try {
            return databaseMetaData.supportsAlterTableWithDropColumn();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsColumnAliasing() {
        try {
            return databaseMetaData.supportsColumnAliasing();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean nullPlusNonNullIsNull() {
        try {
            return databaseMetaData.nullPlusNonNullIsNull();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsConvert() {
        try {
            return databaseMetaData.supportsConvert();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsConvert(int fromType, int toType) {
        try {
            return databaseMetaData.supportsConvert(fromType, toType);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsTableCorrelationNames() {
        try {
            return databaseMetaData.supportsTableCorrelationNames();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsDifferentTableCorrelationNames() {
        try {
            return databaseMetaData.supportsDifferentTableCorrelationNames();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsExpressionsInOrderBy() {
        try {
            return databaseMetaData.supportsExpressionsInOrderBy();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsOrderByUnrelated() {
        try {
            return databaseMetaData.supportsOrderByUnrelated();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsGroupBy() {
        try {
            return databaseMetaData.supportsGroupBy();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsGroupByUnrelated() {
        try {
            return databaseMetaData.supportsGroupByUnrelated();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsGroupByBeyondSelect() {
        try {
            return databaseMetaData.supportsGroupByBeyondSelect();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsLikeEscapeClause() {
        try {
            return databaseMetaData.supportsLikeEscapeClause();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsMultipleResultSets() {
        try {
            return databaseMetaData.supportsMultipleResultSets();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsMultipleTransactions() {
        try {
            return databaseMetaData.supportsMultipleTransactions();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsNonNullableColumns() {
        try {
            return databaseMetaData.supportsNonNullableColumns();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsMinimumSQLGrammar() {
        try {
            return databaseMetaData.supportsMinimumSQLGrammar();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsCoreSQLGrammar() {
        try {
            return databaseMetaData.supportsCoreSQLGrammar();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsExtendedSQLGrammar() {
        try {
            return databaseMetaData.supportsExtendedSQLGrammar();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsANSI92EntryLevelSQL() {
        try {
            return databaseMetaData.supportsANSI92EntryLevelSQL();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsANSI92IntermediateSQL() {
        try {
            return databaseMetaData.supportsANSI92IntermediateSQL();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsANSI92FullSQL() {
        try {
            return databaseMetaData.supportsANSI92FullSQL();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsIntegrityEnhancementFacility() {
        try {
            return databaseMetaData.supportsIntegrityEnhancementFacility();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsOuterJoins() {
        try {
            return databaseMetaData.supportsOuterJoins();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsFullOuterJoins() {
        try {
            return databaseMetaData.supportsFullOuterJoins();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsLimitedOuterJoins() {
        try {
            return databaseMetaData.supportsLimitedOuterJoins();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public String getSchemaTerm() {
        try {
            return databaseMetaData.getSchemaTerm();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public String getProcedureTerm() {
        try {
            return databaseMetaData.getProcedureTerm();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public String getCatalogTerm() {
        try {
            return databaseMetaData.getCatalogTerm();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean isCatalogAtStart() {
        try {
            return databaseMetaData.isCatalogAtStart();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public String getCatalogSeparator() {
        try {
            return databaseMetaData.getCatalogSeparator();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsSchemasInDataManipulation() {
        try {
            return databaseMetaData.supportsSchemasInDataManipulation();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsSchemasInProcedureCalls() {
        try {
            return databaseMetaData.supportsSchemasInProcedureCalls();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsSchemasInTableDefinitions() {
        try {
            return databaseMetaData.supportsSchemasInTableDefinitions();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsSchemasInIndexDefinitions() {
        try {
            return databaseMetaData.supportsSchemasInIndexDefinitions();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsSchemasInPrivilegeDefinitions() {
        try {
            return databaseMetaData.supportsSchemasInPrivilegeDefinitions();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsCatalogsInDataManipulation() {
        try {
            return databaseMetaData.supportsCatalogsInDataManipulation();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsCatalogsInProcedureCalls() {
        try {
            return databaseMetaData.supportsCatalogsInProcedureCalls();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsCatalogsInTableDefinitions() {
        try {
            return databaseMetaData.supportsCatalogsInTableDefinitions();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsCatalogsInIndexDefinitions() {
        try {
            return databaseMetaData.supportsCatalogsInIndexDefinitions();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsCatalogsInPrivilegeDefinitions() {
        try {
            return databaseMetaData.supportsCatalogsInPrivilegeDefinitions();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsPositionedDelete() {
        try {
            return databaseMetaData.supportsPositionedDelete();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsPositionedUpdate() {
        try {
            return databaseMetaData.supportsPositionedUpdate();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsSelectForUpdate() {
        try {
            return databaseMetaData.supportsSelectForUpdate();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsStoredProcedures() {
        try {
            return databaseMetaData.supportsStoredProcedures();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsSubqueriesInComparisons() {
        try {
            return databaseMetaData.supportsSubqueriesInComparisons();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsSubqueriesInExists() {
        try {
            return databaseMetaData.supportsSubqueriesInExists();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsSubqueriesInIns() {
        try {
            return databaseMetaData.supportsSubqueriesInIns();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsSubqueriesInQuantifieds() {
        try {
            return databaseMetaData.supportsSubqueriesInQuantifieds();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsCorrelatedSubqueries() {
        try {
            return databaseMetaData.supportsCorrelatedSubqueries();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsUnion() {
        try {
            return databaseMetaData.supportsUnion();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsUnionAll() {
        try {
            return databaseMetaData.supportsUnionAll();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsOpenCursorsAcrossCommit() {
        try {
            return databaseMetaData.supportsOpenCursorsAcrossCommit();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsOpenCursorsAcrossRollback() {
        try {
            return databaseMetaData.supportsOpenCursorsAcrossRollback();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsOpenStatementsAcrossCommit() {
        try {
            return databaseMetaData.supportsOpenStatementsAcrossCommit();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsOpenStatementsAcrossRollback() {
        try {
            return databaseMetaData.supportsOpenStatementsAcrossRollback();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public int getMaxBinaryLiteralLength() {
        try {
            return databaseMetaData.getMaxBinaryLiteralLength();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public int getMaxCharLiteralLength() {
        try {
            return databaseMetaData.getMaxCharLiteralLength();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public int getMaxColumnNameLength() {
        try {
            return databaseMetaData.getMaxColumnNameLength();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public int getMaxColumnsInGroupBy() {
        try {
            return databaseMetaData.getMaxColumnsInGroupBy();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public int getMaxColumnsInIndex() {
        try {
            return databaseMetaData.getMaxColumnsInIndex();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public int getMaxColumnsInOrderBy() {
        try {
            return databaseMetaData.getMaxColumnsInOrderBy();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public int getMaxColumnsInSelect() {
        try {
            return databaseMetaData.getMaxColumnsInSelect();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public int getMaxColumnsInTable() {
        try {
            return databaseMetaData.getMaxColumnsInTable();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public int getMaxConnections() {
        try {
            return databaseMetaData.getMaxConnections();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public int getMaxCursorNameLength() {
        try {
            return databaseMetaData.getMaxCursorNameLength();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public int getMaxIndexLength() {
        try {
            return databaseMetaData.getMaxIndexLength();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public int getMaxSchemaNameLength() {
        try {
            return databaseMetaData.getMaxSchemaNameLength();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public int getMaxProcedureNameLength() {
        try {
            return databaseMetaData.getMaxProcedureNameLength();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public int getMaxCatalogNameLength() {
        try {
            return databaseMetaData.getMaxCatalogNameLength();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public int getMaxRowSize() {
        try {
            return databaseMetaData.getMaxRowSize();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean doesMaxRowSizeIncludeBlobs() {
        try {
            return databaseMetaData.doesMaxRowSizeIncludeBlobs();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public int getMaxStatementLength() {
        try {
            return databaseMetaData.getMaxStatementLength();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public int getMaxStatements() {
        try {
            return databaseMetaData.getMaxStatements();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public int getMaxTableNameLength() {
        try {
            return databaseMetaData.getMaxTableNameLength();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public int getMaxTablesInSelect() {
        try {
            return databaseMetaData.getMaxTablesInSelect();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public int getMaxUserNameLength() {
        try {
            return databaseMetaData.getMaxUserNameLength();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public int getDefaultTransactionIsolation() {
        try {
            return databaseMetaData.getDefaultTransactionIsolation();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsTransactions() {
        try {
            return databaseMetaData.supportsTransactions();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsTransactionIsolationLevel(int level) {
        try {
            return databaseMetaData.supportsTransactionIsolationLevel(level);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsDataDefinitionAndDataManipulationTransactions() {
        try {
            return databaseMetaData.supportsDataDefinitionAndDataManipulationTransactions();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsDataManipulationTransactionsOnly() {
        try {
            return databaseMetaData.supportsDataManipulationTransactionsOnly();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean dataDefinitionCausesTransactionCommit() {
        try {
            return databaseMetaData.dataDefinitionCausesTransactionCommit();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean dataDefinitionIgnoredInTransactions() {
        try {
            return databaseMetaData.dataDefinitionIgnoredInTransactions();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public JxResultSet getProcedures(String catalog, String schemaPattern, String procedureNamePattern) {
        try {
            return new ResultSetImpl(databaseMetaData.getProcedures(catalog, schemaPattern, procedureNamePattern), jannex);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public JxResultSet getProcedureColumns(String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern) {
        try {
            return new ResultSetImpl(databaseMetaData.getProcedureColumns(catalog, schemaPattern, procedureNamePattern, columnNamePattern), jannex);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public JxResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) {
        try {
            return new ResultSetImpl(databaseMetaData.getTables(catalog, schemaPattern, tableNamePattern, types), jannex);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public JxResultSet getSchemas() {
        try {
            return new ResultSetImpl(databaseMetaData.getSchemas(), jannex);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public JxResultSet getCatalogs() {
        try {
            return new ResultSetImpl(databaseMetaData.getCatalogs(), jannex);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public JxResultSet getTableTypes() {
        try {
            return new ResultSetImpl(databaseMetaData.getTableTypes(), jannex);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public JxResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) {
        try {
            return new ResultSetImpl(databaseMetaData.getColumns(catalog, schemaPattern, tableNamePattern, columnNamePattern), jannex);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public JxResultSet getColumnPrivileges(String catalog, String schema, String table, String columnNamePattern) {
        try {
            return new ResultSetImpl(databaseMetaData.getColumnPrivileges(catalog, schema, table, columnNamePattern), jannex);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public JxResultSet getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern) {
        try {
            return new ResultSetImpl(databaseMetaData.getTablePrivileges(catalog, schemaPattern, tableNamePattern), jannex);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public JxResultSet getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable) {
        try {
            return new ResultSetImpl(databaseMetaData.getBestRowIdentifier(catalog, schema, table, scope, nullable), jannex);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public JxResultSet getVersionColumns(String catalog, String schema, String table) {
        try {
            return new ResultSetImpl(databaseMetaData.getVersionColumns(catalog, schema, table), jannex);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public JxResultSet getPrimaryKeys(String catalog, String schema, String table) {
        try {
            return new ResultSetImpl(databaseMetaData.getPrimaryKeys(catalog, schema, table), jannex);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public JxResultSet getImportedKeys(String catalog, String schema, String table) {
        try {
            return new ResultSetImpl(databaseMetaData.getImportedKeys(catalog, schema, table), jannex);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public JxResultSet getExportedKeys(String catalog, String schema, String table) {
        try {
            return new ResultSetImpl(databaseMetaData.getExportedKeys(catalog, schema, table), jannex);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public JxResultSet getCrossReference(String parentCatalog, String parentSchema, String parentTable, String foreignCatalog, String foreignSchema, String foreignTable) {
        try {
            return new ResultSetImpl(databaseMetaData.getCrossReference(parentCatalog, parentSchema, parentTable, foreignCatalog, foreignSchema, foreignTable), jannex);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public JxResultSet getTypeInfo() {
        try {
            return new ResultSetImpl(databaseMetaData.getTypeInfo(), jannex);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public JxResultSet getIndexInfo(String catalog, String schema, String table, boolean unique, boolean approximate) {
        try {
            return new ResultSetImpl(databaseMetaData.getIndexInfo(catalog, schema, table, unique, approximate), jannex);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsResultSetType(int type) {
        try {
            return databaseMetaData.supportsResultSetType(type);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsResultSetConcurrency(int type, int concurrency) {
        try {
            return databaseMetaData.supportsResultSetConcurrency(type, concurrency);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean ownUpdatesAreVisible(int type) {
        try {
            return databaseMetaData.ownUpdatesAreVisible(type);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean ownDeletesAreVisible(int type) {
        try {
            return databaseMetaData.ownDeletesAreVisible(type);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean ownInsertsAreVisible(int type) {
        try {
            return databaseMetaData.ownInsertsAreVisible(type);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean othersUpdatesAreVisible(int type) {
        try {
            return databaseMetaData.othersUpdatesAreVisible(type);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean othersDeletesAreVisible(int type) {
        try {
            return databaseMetaData.othersDeletesAreVisible(type);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean othersInsertsAreVisible(int type) {
        try {
            return databaseMetaData.othersInsertsAreVisible(type);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean updatesAreDetected(int type) {
        try {
            return databaseMetaData.updatesAreDetected(type);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean deletesAreDetected(int type) {
        try {
            return databaseMetaData.deletesAreDetected(type);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean insertsAreDetected(int type) {
        try {
            return databaseMetaData.insertsAreDetected(type);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsBatchUpdates() {
        try {
            return databaseMetaData.supportsBatchUpdates();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public JxResultSet getUDTs(String catalog, String schemaPattern, String typeNamePattern, int[] types) {
        try {
            return new ResultSetImpl(databaseMetaData.getUDTs(catalog, schemaPattern, typeNamePattern, types), jannex);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public JxConnection getConnection() {
        try {
            return new ConnectionImpl(databaseMetaData.getConnection(), jannex);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsSavepoints() {
        try {
            return databaseMetaData.supportsSavepoints();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsNamedParameters() {
        try {
            return databaseMetaData.supportsNamedParameters();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsMultipleOpenResults() {
        try {
            return databaseMetaData.supportsMultipleOpenResults();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsGetGeneratedKeys() {
        try {
            return databaseMetaData.supportsGetGeneratedKeys();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public JxResultSet getSuperTypes(String catalog, String schemaPattern, String typeNamePattern) {
        try {
            return new ResultSetImpl(databaseMetaData.getSuperTypes(catalog, schemaPattern, typeNamePattern), jannex);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public JxResultSet getSuperTables(String catalog, String schemaPattern, String tableNamePattern) {
        try {
            return new ResultSetImpl(databaseMetaData.getSuperTables(catalog, schemaPattern, tableNamePattern), jannex);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public JxResultSet getAttributes(String catalog, String schemaPattern, String typeNamePattern, String attributeNamePattern) {
        try {
            return new ResultSetImpl(databaseMetaData.getAttributes(catalog, schemaPattern, typeNamePattern, attributeNamePattern), jannex);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsResultSetHoldability(int holdability) {
        try {
            return databaseMetaData.supportsResultSetHoldability(holdability);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public int getResultSetHoldability() {
        try {
            return databaseMetaData.getResultSetHoldability();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public int getDatabaseMajorVersion() {
        try {
            return databaseMetaData.getDatabaseMajorVersion();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public int getDatabaseMinorVersion() {
        try {
            return databaseMetaData.getDatabaseMinorVersion();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public int getJDBCMajorVersion() {
        try {
            return databaseMetaData.getJDBCMajorVersion();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public int getJDBCMinorVersion() {
        try {
            return databaseMetaData.getJDBCMinorVersion();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public int getSQLStateType() {
        try {
            return databaseMetaData.getSQLStateType();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean locatorsUpdateCopy() {
        try {
            return databaseMetaData.locatorsUpdateCopy();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsStatementPooling() {
        try {
            return databaseMetaData.supportsStatementPooling();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public RowIdLifetime getRowIdLifetime() {
        try {
            return databaseMetaData.getRowIdLifetime();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public JxResultSet getSchemas(String catalog, String schemaPattern) {
        try {
            return new ResultSetImpl(databaseMetaData.getSchemas(catalog, schemaPattern), jannex);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean supportsStoredFunctionsUsingCallSyntax() {
        try {
            return databaseMetaData.supportsStoredFunctionsUsingCallSyntax();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean autoCommitFailureClosesAllResultSets() {
        try {
            return databaseMetaData.autoCommitFailureClosesAllResultSets();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public JxResultSet getClientInfoProperties() {
        try {
            return new ResultSetImpl(databaseMetaData.getClientInfoProperties(), jannex);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public JxResultSet getFunctions(String catalog, String schemaPattern, String functionNamePattern) {
        try {
            return new ResultSetImpl(databaseMetaData.getFunctions(catalog, schemaPattern, functionNamePattern), jannex);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public JxResultSet getFunctionColumns(String catalog, String schemaPattern, String functionNamePattern, String columnNamePattern) {
        try {
            return new ResultSetImpl(databaseMetaData.getFunctionColumns(catalog, schemaPattern, functionNamePattern, columnNamePattern), jannex);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public JxResultSet getPseudoColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) {
        try {
            return new ResultSetImpl(databaseMetaData.getPseudoColumns(catalog, schemaPattern, tableNamePattern, columnNamePattern), jannex);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean generatedKeyAlwaysReturned() {
        try {
            return databaseMetaData.generatedKeyAlwaysReturned();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public void close() {
    }

    @Override
    @SuppressWarnings("unchecked")
    public <T> T unwrap(Class<T> iface) {
        try {
            if (iface.equals(DatabaseMetaData.class)) {
                return (T) databaseMetaData;
            }
            return databaseMetaData.unwrap(iface);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public boolean isWrapperFor(Class<?> iface) {
        try {
            return iface.equals(DatabaseMetaData.class) || databaseMetaData.isWrapperFor(iface);
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

}
